<?php 

$sqlm =  "SELECT 
			  p.info_id,
			  p.published,
			  d.title,
			  d.description
						
		FROM 
			  infos AS p,
			  info_description AS d
		WHERE 
			 p.info_id = '".$query."'
			 AND p.info_id = d.info_id
			 AND d.lang_id = '".$_SESSION["lang_id"]."'
		 ";
			
$rowm = mysql_fetch_object(query($sqlm)); 


$sqlp =  "SELECT 
			  p.info_id,
			  p.published,
			  d.title,
			  d.description
						
		FROM 
			  infos AS p,
			  info_description AS d
		WHERE 
			 p.parent_id = '".$query."'
			 AND p.info_id = d.info_id
			 AND d.lang_id = '".$_SESSION["lang_id"]."'
			 AND  p.published
			 ORDER BY p.order_number
		 ";
$parents = query($sqlp);			
$tabs = '';
		$content = '';
		$i = 0;
		while($rowp = mysql_fetch_object($parents))
		{	$i++;
			$tabs    .= '<li><a href="#info'.$query.'-tab'.$i.'">'.stripslashes($rowp->title).'</a></li>';
			$content .= '<div id="info'.$query.'-tab'.$i.'" class="inner-tab">'.stripslashes($rowp->description).'</div>';
		}


?>

  
        <?=stripslashes($rowm->description)?>
     <script>
		 $('#popup-page header h2').html('<?=stripslashes($rowm->title)?>');
	 </script>  
<?php
	if($tabs){
?>
		<div class="cf inner-tabs-container" id="info<?=$query?>tabs">

		<ul><?=$tabs?></ul>
        <?=$content?>
        </div>
        
        <script>
		  $("#info<?=$query?>tabs").easytabs();
		</script>
<?php	
	}
?>